/*
 * AIVariationResource.h
 *
 *  Created on: 2013. 9. 10.
 *      Author: mega@gamevil.com
 */

#ifndef AIVARIATIONRESOURCE_H_
#define AIVARIATIONRESOURCE_H_

#include <map>

namespace ProjectZ { namespace NResource {

class AIVariationData
{
public:
	struct Flyweight
	{
		int _MIN_LEVEL;
		int _MAX_LEVEL;
		int _SLASHER;
		int _RANGER;
		int _FIGHTER;
		int _MAGICIAN;
		int _ASSASSIN;
		int _PALADIN;
	};

public:
	AIVariationData() {}
	virtual ~AIVariationData();

	bool LoadResource(int company, int saleCode);
	Flyweight * GetPvPFly(int level);
	Flyweight * GetPkFly(int level);

private:
	void	Clear();

private:
	typedef std::map<int, Flyweight *>	DATATREE;
	DATATREE	clsPvPFlyTree;
	DATATREE	clsPkFlyTree;
};


class AIVariationResource
{
public:
	AIVariationResource();
	virtual ~AIVariationResource();

	bool LoadResource();
	AIVariationData::Flyweight * GetFly(User * pUser, int level, bool bPvP=true);

private:
	AIVariationData * pAIVariationAD;
	AIVariationData * pAIVariationIOS;
};

} /*NResource*/ } /* namespace ProjectZ */

#endif /* AIVARIATIONRESOURCE_H_ */
